import request from '@/utils/request'

// 获取文章详情内容
export const getArtilceInfo = (articleId) => {
  return request({
    method: 'GET',
    url: `/articles/${articleId}`
  })
}

// 文章点赞
export const addArticlePraise = (articleId) => {
  return request({
    method: 'POST',
    url: '/articles/praise',
    data: {
      articleId
    }
  })
}

// 取消文章点赞
export const delArticlePraise = (articleId) => {
  return request({
    method: 'DELETE',
    url: '/articles/praise',
    data: {
      articleId
    }
  })
}

// 收藏文章
export const addArticleCollection = (articleId) => {
  return request({
    method: 'POST',
    url: '/articles/collection',
    data: {
      articleId
    }
  })
}

// 取消文章收藏
export const delArticleCollection = (articleId) => {
  return request({
    method: 'DELETE',
    url: '/articles/collection',
    data: {
      articleId
    }
  })
}
